﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;
using Media.Core.Data;
using Media.Core.Models.Downloads;

namespace Media.Web.Controllers
{
    public class DownloadsController : Controller
    {
        //
        // GET: /Downloads/

        public ActionResult Index()
        {

            var dtDownloadTabs = Connections.GetDataTable("Downloads_Get_Tabs");

            var tabs = new TabsArray();

            foreach (DataRow drDownloadTab in dtDownloadTabs.Rows)
            {
                tabs.DownloadTab.Add(new Tabs
                {
                    Id = Convert.ToInt32(drDownloadTab["Id"].ToString()),
                    Name = drDownloadTab["Name"].ToString(),
                    Url = drDownloadTab["Url"].ToString()
                });
            }

            return View(tabs);
        }

    }
}
